﻿using NanoVirtualView;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 图片裁剪压缩工具
{
    public abstract class BaseRectView : BaseVirtualView
    {
        public delegate void RectEventHandler(object sender,RectangleF rect);

        public event RectEventHandler SizeChanged;
        public event RectEventHandler LocationChanged;
        protected BaseRectView(VirtualViewRegister register) : base(register)
        {
        }
        public new SizeF Size
        {
            get => base.Size;
            set
            {
                base.Size = value;
                SizeChanged?.Invoke(this, Rectangle);
            }
        }
        public new float Width
        {
            get => base.Width;
            set
            {
                base.Width = value;
                SizeChanged.Invoke(this, Rectangle);
            }
        }
        public new float Height
        {
            get => base.Height;
            set
            {
                base.Height = value;
                SizeChanged.Invoke(this, Rectangle);
            }
        }
        public new PointF Location
        {
            get => base.Location;
            set
            {
                base.Location = value;
                LocationChanged?.Invoke(this, Rectangle);
            }
        }
        public new float Left
        {
            get => base.Left;
            set
            {
                base.Left = value;
                LocationChanged?.Invoke(this, Rectangle);
            }
        }
        public new float Top
        {
            get => base.Top;
            set
            {
                base.Top = value;
                LocationChanged?.Invoke(this, Rectangle);
            }
        }
    }
}
